{% extends "base.html" %}
{% load i18n %}
{% block title%}{% trans "luca_template_list" %}{% endblock%}
{% block breadcrumbs%}<li>{% trans "luca_statistic_list" %}</li>{% endblock%}

 
{% block content %}

<div class="box-inner">
                <div class="box-header well" data-original-title="">
                    <h2>{% trans "luca_statistic_list" %}</h2>

                </div>
                <div class="box-content">
                	 <form action="?" method="GET">
 	<div class="row">
 		<div class="col-xs-12 col-sm-2">
 			<input type="text" class="datepicker form-control" placeholder="{% trans "luca_statistic_fromdate" %}" name="fromdate" value="{{request.GET.fromdate}}">
 		</div>
 		<div class="col-xs-12 col-sm-2">
 			<input type="text" class="datepicker form-control" placeholder="{% trans "luca_statistic_todate" %}" name="todate" value="{{request.GET.todate}}">
 		</div>
 		<div class="col-xs-6 col-sm-4">
 			<select class="form-control medium-input" name="status">
 				<option value="none">{% trans "luca_statistic_status" %}</option>
 				 {% for data in status %}
  				<option value="{{ forloop.counter }}" {% if forloop.counter|stringformat:"s" in request.GET.status %} selected {% endif %}>{{ data }}</option>
 			     {% endfor %}
 			</select>
 		</div>
 	

 		<div class="col-xs-6 col-sm-2">
 			<select class="form-control small-input" name="page">
 				<option value="none">{% trans "luca_statistic_page" %}</option>
 				{% with ''|center:sms_page as range %}
				{% for _ in range %}
				    <option value="{{ forloop.counter0 }}" {% if forloop.counter0|stringformat:"s" in request.GET.page %} selected {% endif %}>{{ forloop.counter0 }}</option>
				{% endfor %}
				{% endwith %}
 			</select>
 		</div>
 		<div class="col-xs-12 col-sm-2">
 			<input type="submit" class="form-control" value="{% trans "luca_statistic_search" %}">
 		</div>
 	</div>

</form>  



                    <table class="table table-bordered table-striped table-condensed">
                        <thead>
                        <tr>
                            <th class="hidden-xs">{% trans "luca_statistic_smsid" %}</th>
                            <th>{% trans "luca_statistic_phone" %}</th>
                            <th class="hidden-xs">{% trans "luca_statistic_text" %}</th>
                            <th>{% trans "luca_statistic_sentdate" %}</th>
                            <th class="hidden-xs">{% trans "luca_statistic_price" %}</th>
                            <th>{% trans "luca_statistic_status" %}</th>
                        </tr>
                        </thead>
                        <tbody>
				 <tr>&nbsp;</tr>
          	  	  {% for data in listdata %}
          			 <tr>
                            <td class="hidden-xs"> {{data.SMSsentID}}</td>
                            <td class="center">{{data.PhoneNumber}}</td>
                            <td class="center hidden-xs"><div class="tooltip-hint " data-toggle="tooltip" data-placement="top" title="{{data.Message}}">{{data.Message|truncatechars:60}}</div></td>
                            <td class="center">{{data.SentDate}}</td>
                            <td class="center hidden-xs">{{data.Price}}</td>
                            <td class="center">
                    
								{% switch data.SMSsentStatus %}
								    {% case "0" "1" %}
										<span class="label-warning label label-default">
									    	{% trans "luca_statistic_sending" %}
									    </span>
								    {% case "2" %}
										<span class="label-success label label-default">
									    	{% trans "luca_statistic_sent" %}
									    </span>
									    
									{% case "3" %}
										<span class="label-default label label-danger">
									    	{% trans "luca_statistic_failed" %}
									    </span>
									{% case "4" %}
										<span class="label-default label">
									    	{% trans "luca_statistic_deleted" %}
									    </span>	        
								    {% else %}
								       <span class="label-default label">
									    	{% trans "luca_statistic_other" %}
									    </span>   
								{% endswitch %}
	
							
                            </td>
                        </tr>
                        
						    {% endfor %}
                   
                        </tbody>
                    </table>

                </div>
            </div>

{% endblock %}
